//
//  String+Extension.swift
//  weiBoOfSwift
//
//  Created by simon on 15/12/19.
//  Copyright © 2015年 simon. All rights reserved.
//

import UIKit

extension String{

    func matchRegexString(regex:String)->[DXMatchRegModel]{
         var matchModels = [DXMatchRegModel]()
        (self as NSString).enumerateStringsMatchedByRegex(regex) { (_, resultStr, resultRange, _) -> Void in
            let matchResult = DXMatchRegModel(string: resultStr.memory! as String, range: resultRange.memory)
            matchModels.append(matchResult)
        }
      return matchModels
    }




}
